package com.joker.controller;

import com.joker.service.BlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @Author JokerKS
 * @Date 2021/12/10 10:33
 * @Version 1.0
 */
@Controller
public class ArchivesController {

	@Autowired
	private BlogService blogService;

	@GetMapping("/archives")
	public String archives(Model model) {
		model.addAttribute("archiveMap", blogService.archivesBlog());
		model.addAttribute("blogCount", blogService.archivesBlogCount());
		return "archives";
	}
}
